package net.my.msn.dao.impl;

import javax.persistence.Query;

import org.springframework.stereotype.Repository;

import net.my.msn.dao.JpaImplTemplateDAO;
import net.my.msn.dao.MessageDAO;
import net.my.msn.domain.Message;
import java.util.*;

@Repository
public class MessageDAOImpl extends JpaImplTemplateDAO<Message, Long> implements
		MessageDAO {

	public MessageDAOImpl() {
		super(Message.class);
	}
	
	@SuppressWarnings("unchecked")
	public List<Message> find(){
		Query q=em.createNamedQuery("findAllMessages");
		return q.getResultList();
	}
}
